package safari.model.sell;

import org.apache.log4j.Logger;
import org.aspectj.lang.ProceedingJoinPoint;

import com.ibatis.common.logging.Log;

public class SellBoardKeywordAroundLogging {
	private Object returnValue=null;
	private SellBoardService sellBoardService;
	private Logger log=Logger.getLogger(SellBoardKeywordAroundLogging.class);
	public SellBoardKeywordAroundLogging(SellBoardService sellBoardService){
		this.sellBoardService=sellBoardService;
	}
	public Object aroundLog(ProceedingJoinPoint point) throws Throwable{
		String className=point.getTarget().getClass().toString();
		String methodName=point.getSignature().toString();
		Object[] args=point.getArgs();
		SellBoardSearchVO sbsvo=(SellBoardSearchVO)args[0];
		String keyword=sbsvo.getKeyword();
		log.info("클래스명:"+className+" 메서드명:"+methodName+" 검색어:"+keyword);
		returnValue=point.proceed();
		sellBoardService.recordHotKeyword(keyword);
		return returnValue;
	}
}
